package com.alienlab.finder.service;

import com.alienlab.finder.domain.Relationship;

import com.alienlab.finder.service.dto.RelationshipDTO;
import com.alienlab.finder.service.dto.UserState;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Optional;

/**
 * Service Interface for managing Relationship.
 */
public interface RelationshipService {

    /**
     * Save a relationship.
     *
     * @param relationship the entity to save
     * @return the persisted entity
     */
    Relationship save(Relationship relationship);

    /**
     * Get all the relationships.
     *
     * @param pageable the pagination information
     * @return the list of entities
     */
    Page<Relationship> findAll(Pageable pageable);


    /**
     * Get the "id" relationship.
     *
     * @param id the id of the entity
     * @return the entity
     */
    Optional<Relationship> findOne(Long id);

    /**
     * Delete the "id" relationship.
     *
     * @param id the id of the entity
     */
    void delete(Long id);

    Relationship creatRelation(String main_open_id,String second_open_id) throws Exception;

    Relationship updateRelation(String main_open_id,String second_open_id,String relation,String distance,String nickname) throws Exception;

    void deleteRelation(String main_open_id,String second_open_id) throws Exception;

    List<RelationshipDTO> findRelationsByMainopenid(String main_open_id);

    List<UserState> getOnlineState(String main_open_id);

    void sendOnlineStateRequset(String second_open_id) throws Exception;

    Relationship getRelation(String main_open_id,String second_open_id);





}
